<!-- 员工打卡管理 -->
<template>
  <BaseContainer>
    <aplid-base-crud ref="crud" class="w-100" v-bind="{ ...theConfig, ...$attrs }" :api="api" :auth="auth"
      :detailConfig="detailEmployeeConfig" :paramsObj="{ personType: 2, code: 3024,isWithAuth:props.isWithAuth,idCard:parNowRowData.idCard}">
    </aplid-base-crud>
  </BaseContainer>
</template>

<script setup lang="ts">
import { baseConfig, detailEmployeeConfig } from './employeeConfig'
import { editConfig } from '@/views/datacenter/comprehensiveQueries/utils/index'

type Props = {
	isWithAuth?:any,
  isComprehensiveQueries?:boolean,
}
let props = withDefaults(defineProps<Props>(),{
	isWithAuth:undefined,
  isComprehensiveQueries:false
})

const parNowRowData: any = inject('nowRowData') ||{}

const api = {
  moreSearch: 'view_dpOrgPunchRecord_search',
  index: 'view_dpOrgPunchRecord_page',
  delete: 'view_dpOrgPunchRecord_del',
  import: 'view_dpOrgPunchRecord_import',
  export: 'view_dpOrgPunchRecord_export_staff',
  edit: 'view_dpOrgPunchRecord_edit',
}

const auth = {
  index: 'view_dpOrgPunchRecord_page',
  delete: 'view_dpOrgPunchRecord_del',
  // import: 'view_dpOrgPunchRecord_import',
  export: 'view_dpOrgPunchRecord_export',
  edit: 'view_dpOrgPunchRecord_edit',
  mulitSet: 'mulitSet',
}
let theConfig :any= ref({})

if(baseConfig){
  let defaultConfig = JSON.parse(JSON.stringify(baseConfig))
  if(props.isComprehensiveQueries){
    theConfig.value = editConfig(defaultConfig)
    api.index = 'view_dpOrgPunchRecord_search'
    auth.index = 'view_dpOrgPunchRecord_search'
  }else{
    theConfig.value = baseConfig
  }
  
}
</script>

<style scoped></style>